<template>
<div class="larg-box">
    <!--左侧一级导航-->
    <div class="left-box">
        <ul class="left-box-body">
            <li class="items-li" v-for="(item,index) in linkList" :key="index">
                <router-link :to="item.route">
                    <img :src="item.PicLink" alt />
                    <span>{{item.title}}</span>
                </router-link>
            </li>
        </ul>
    </div>
    <!-- 二阶 侧边导航 -->
    <div v-show="istrue" class="right-box">
        <Aside></Aside>
    </div>
</div>
</template>

<script>
import Aside from "@/components/Aside";
export default {
    components: {
        Aside,
    },
    data() {
        return {
            istrue: true,
            linkList: [{
                    route: "/index/IncorruptibleArchives",
                    title: "廉政档案",
                    code: "xtsz-zzjg",
                    PicLink: require("@/assets/image/link-1.png"),
                },
                {
                    route: "/index/SuperviseAndReport",
                    title: "监督举报",
                    code: "xtsz-jsgl",
                    PicLink: require("@/assets/image/link-2.png"),
                },
                {
                    route: "/index/Patrol",
                    title: "巡视巡察",
                    code: "xtsz-yhgl",
                    PicLink: require("@/assets/image/link-3.png"),
                },
                {
                    route: "/index/PortalManagement/Home",
                    title: "门户管理",
                    code: "important_grzx",
                    PicLink: require("@/assets/image/link-4.png"),
                },
                {
                    route: "/index/SystemSettings",
                    title: "系统设置",
                    code: "xtsz-zdgl",
                    PicLink: require("@/assets/image/link-5.png"),
                },
            ],
        };
    },
    created() {
        this.isExhibition();
    },
    watch: {
        //监听路由变化，当路由改变是判断是否渲染二级导航栏
        $route(to, from) {
            this.isExhibition();
        },
    },
    methods: {
        isExhibition() {
            let router_path = this.$route.path;
            // console.log(router_path, "router_path")
            if (router_path === "/index/welcomePage") {
                this.istrue = false;
            } else {
                this.istrue = true;
            }
        },
    },
};
</script>

<style lang="less" scoped>
.larg-box {
    height: 100%;
    width: 100%;
    display: flex;
    // margin-right: -15px;
    // margin-bottom: -15px;
    // overflow: hidden;
}

.left-box {
    width: 100px;
    height: 100%;
    // z-index: 2000;
    // overflow: hidden;
}

.right-box {
    width: 200px;
    height: 100%;
    // z-index: 2000;
    overflow: hidden;
}

.left-box-body {
    height: 100%;
    // width: 100px;
    overflow: auto;
    background: rgba(0, 33, 64, 1);
}

.items-li>a {
    display: inline-block;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    line-height: 0;

    span {
        display: inline-block;
        width: 56px;
        height: 20px;
        font-size: 14px;
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        line-height: 20px;
        margin-bottom: 16px;
    }
}

.items-li {
    height: 75px;
    width: 100px;
    margin-bottom: 43px;
}

img {
    width: 23px;
    height: 26px;
    margin-top: 37px;
    margin-bottom: 11px;
}

/deep/ .router-link-active {
    background: #3d7fff !important;
}
</style>
